/******************************************************************************
** @file	FileDirectory.h
** @author	Joel Chuca 
** @author	Marcel Morales
** @date	Jul 25, 2010
**
** @desc	This class represent a directory or file entry on a computer system
*           running Windows.
*			
**
******************************************************************************/

#ifndef _FILEDIRECTORY_H
#define _FILEDIRECTORY_H

#include <string>
#include <Wbemidl.h>
#include <comdef.h>
#include "Utils.h"
#include "WinObject.h"
#include <exception>

class FileDirectory: public WinObject
{
public:

    /**
    * FileDirectory Constructor initilize all properties.
    * @param IWbemClassObject* pointer to a IWbemClassObject instance.
    */
    FileDirectory(IWbemClassObject*);

    ~FileDirectory();

    /**
    * Loads the properties to this object
    */
    void setProperties();

    /**
    * Gets the 'caption' property
    */
    const wstring& getCaption();

    /*
    * Sets the 'caption' property
    */
    void setCaption(const wstring& caption);

    /**
    * Gets the 'description' property
    */
    const wstring& getDescription();

    /*
    * Sets the 'description' property
    */
    void setDescription(const wstring& des);

    /**
    * Gets the 'name' property
    */
    const wstring& getName();

    /*
    * Sets the 'name' property
    */
    void setName(const wstring& name);

    /**
    * Gets the 'status' property
    */
    const wstring& getStatus();

    /*
    * Sets the 'status' property
    */
    void setStatus(const wstring& status);

    /**
    * Gets the 'installDate' property
    */
    const CTime& getInstallDate();

    /*
    * Sets the 'installDate' property
    */
    void setInstallDate(const CTime& time);

    /**
    * Gets the 'creationDate' property
    */
    const CTime& getCreationDate();

    /*
    * Sets the 'creationDate' property
    */
    void setCreationDate(const CTime& time);

    /**
    * Gets the 'lastAccessed' property
    */
    const CTime& getLastAccessed();

    /*
    * Sets the 'lastAccessed' property
    */
    void setLastAccessed(const CTime& time);

    /**
    * Gets the 'lastModified' property
    */
    const CTime& getLastModified();

    /*
    * Sets the 'description' property
    */
    void setLastModified(const CTime& time);

    /**
    * Gets the 'description' property
    */
    const bool isWriteable();

    /*
    * Sets the 'description' property
    */
    void setWriteable(bool wri);

    /*
    * Overrides of method. Prints in console some propeties
    */
    void toString();
protected:
    /**
    * Holds short description (one-line string) of the object.
    */
    wstring _caption;

    /**
    * Holds Description of the object
    */
    wstring _description;

    /**
    * Holds the date the object was installed. This property does not require
    * a value to indicate that the object is installed. 
    */
    CTime _installDate;

    /**
    * Holds the name that serves as a key of a logical file instance within a 
    * file system. Full path names should be provided
    */
    wstring _name;

    /**
    * Holds the current status of the object. The values are: "Error", 
    * "Starting", "Stopping", and "Service". The latter, "Service"
    */
    wstring _status;

    /**
    * Holds the date of the file was created.
    */
    CTime _creationDate;

    /**
    * Holds the date of the file was last accessed.
    */
    CTime _lastAccessed;

    /**
    * Holds the date of the file was modified.
    */
    CTime _lastModified;

    /**
    * Holds a boolean data. If True, the file can be written.
    */
    bool _writeable;

    /**
    * Holds a pointer to a IWbemClassObject instance.
    */
    IWbemClassObject* _pclsObj;

};

#endif